Skip to content

fix(ltx_2): use LTXModelConfig.from_dict to filter unknown config keys#39

Open
jdcruz-strategy wants to merge 1 commit into
Blaizzy:mainfrom
jdcruz-strategy:fix-ltx2-config-extra-keys
Open

fix(ltx_2): use LTXModelConfig.from_dict to filter unknown config keys#39
jdcruz-strategy wants to merge 1 commit into
Blaizzy:mainfrom
jdcruz-strategy:fix-ltx2-config-extra-keys

Conversation

@jdcruz-strategy

Copy link
Copy Markdown

Summary

  • LTXModel.from_pretrained() constructs the config with LTXModelConfig(**config_dict), which crashes on a TypeError whenever the downloaded config.json includes extra diffusers metadata fields (e.g. _class_name, _diffusers_version). I hit this loading both Lightricks/LTX-2 and prince-canuma/LTX-2-distilled.
  • BaseModelConfig.from_dict() already exists specifically to filter a dict down to valid constructor params, but from_pretrained() wasn't using it. Swapping the direct constructor call for .from_dict() fixes the crash with no behavior change for already-clean config dicts.

Test plan

  • Reproduced the crash on a clean clone loading both Lightricks/LTX-2 and prince-canuma/LTX-2-distilled checkpoints.
  • Applied the one-line fix and successfully ran python -m mlx_video.models.ltx_2.generate end-to-end on Apple Silicon (M-series, MLX/Metal device), producing a valid output video.

from_pretrained() called LTXModelConfig(**config_dict) directly, which
crashes when the downloaded config.json includes diffusers metadata
fields like _class_name and _diffusers_version (present in e.g.
Lightricks/LTX-2 and prince-canuma/LTX-2-distilled checkpoints).
BaseModelConfig.from_dict() already exists to filter to valid
constructor params — use it here instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant